package cn.ryh.gat1400.controller;

import cn.ryh.gat1400.core.Response;
import cn.ryh.gat1400.model.MotorVehicle;
import cn.ryh.gat1400.model.MotorVehicleListObject;
import cn.ryh.gat1400.model.ResponseStatus;
import cn.ryh.gat1400.model.ResponseStatusListModeObject;
import cn.ryh.gat1400.model.ResponseStatusObject;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import java.util.ArrayList;
import java.util.List;

/**
 * 机动车
 *
 * @author Raoyh
 * @Description
 * @create 2022-09-05 9:24
 */
@Slf4j
@RestController
@RequestMapping("/VIID/MotorVehicles")
public class MotorVehiclesController {

    private static final String REQ_URL = "/VIID/MotorVehicles";
    /**
     * 添加
     *
     * @param motorVehicleListObject
     * @return
     */
    @PostMapping()
    public ResponseStatusListModeObject addFaces(@RequestBody MotorVehicleListObject motorVehicleListObject) {
        log.info(motorVehicleListObject.toString());
        List<ResponseStatus> resp3 = new ArrayList<>();
        ResponseStatus r = new ResponseStatus();
        resp3.add(r);
        return Response.ok(resp3);
    }

    /**
     * 查询
     *
     * @return
     */
    @GetMapping()
    public ResponseStatusListModeObject seleteFaces(MotorVehicle motorVehicle) {
        List<ResponseStatus> resp3 = new ArrayList<>();
        ResponseStatus r = new ResponseStatus();
        resp3.add(r);
        return Response.ok(resp3);
    }

    /**
     * 修改
     *
     * @param motorVehicleListObject
     * @return
     */
    @PutMapping()
    public ResponseStatusListModeObject editFaces(@RequestBody MotorVehicleListObject motorVehicleListObject) {
        List<ResponseStatus> resp3 = new ArrayList<>();
        ResponseStatus r = new ResponseStatus();
        resp3.add(r);
        return Response.ok(resp3);
    }

    /**
     * 删除
     *
     * @param ids
     * @return
     */
    @DeleteMapping()
    public ResponseStatusListModeObject delFaces(@RequestParam("IDList") String ids) {
        List<ResponseStatus> resp3 = new ArrayList<>();
        ResponseStatus r = new ResponseStatus();
        resp3.add(r);
        return Response.ok(resp3);
    }

    /**
     * 查询
     *
     * @param id
     * @return
     */
    @GetMapping(value = "/{ID}")
    public ResponseStatusObject seleteFace(@PathVariable("ID") String id) {
        return Response.ok(id, REQ_URL, "查询成功");
    }

    /**
     * 修改
     *
     * @param id
     * @return
     */
    @PutMapping(value = "/{ID}")
    public ResponseStatusObject editFace(@PathVariable("ID") String id, @RequestBody MotorVehicle motorVehicle) {
        return Response.ok(id, REQ_URL, "修改成功");
    }

    /**
     * 删除
     *
     * @param id
     * @return
     */
    @DeleteMapping(value = "/{ID}")
    public ResponseStatusObject delFace(@PathVariable("ID") String id) {
        return Response.ok(id, REQ_URL, "删除成功");
    }
}
